
package util;
/**
  * SemType implements a representation of types for supporting
  * typechecking of simple languages.
  */

public enum X86regs {
    EAX("eax")	//arithmetic
    , EBX("ebx") //points to the first element of var()
    , ECX("ecx") //result register
    , EDI("edi") //points to the first element of temp()
    , ESI("esi") //points to the first element of arg/param
    , ESP("esp"), EBP("ebp");

    private final String name;
    private X86regs(String name){
	this.name = name;
    }
    public String toString(){
	return "%"+name;
    }
    /*public static X86regs parseType(String incoming){
	for(X86regs t : X86regs.values()){
	    if(incoming.contains(t.toString()))
		return t;
	}
	return UNKNOWN;
    }*/
    public boolean equals(String incoming){
	return name.equals(incoming);
    }
    public boolean equals(X86instr incoming){
	return name.equals(incoming.toString());
    }



}